package com.ribbon.lcn.serviceb.service.impl;


import com.codingapi.txlcn.tc.annotation.LcnTransaction;
import com.ribbon.lcn.serviceb.repository.AccountRepository;
import com.ribbon.lcn.serviceb.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author: Ribbon
 * @Date 2019/2/22 15:02
 **/
@Transactional
@Service
public class AccountServiceImpl implements AccountService {

    @Autowired
    private AccountRepository accountRepository;

    @Override
    @LcnTransaction
    public void debit(String userId, int money) {
        accountRepository.debit(userId,money);
    }
}
